package com.maimao.model.search;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 创建es文档
 *
 * @author MaoLin Wang
 * @date 2021/1/3 8:22 下午
 */
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class DocInput implements Serializable {

    private static final long serialVersionUID = -802509813056815610L;
    @NotBlank(message = "索引不能为空")
    private String index;
    private Long id;

    @NotBlank(message = "数据不能为空")
    private String jsonSource;

    /**
     * 6.X需要指定type
     */
    @NotBlank(message = "type不能为空")
    private String type;

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getJsonSource() {
        return jsonSource;
    }

    public void setJsonSource(String jsonSource) {
        this.jsonSource = jsonSource;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}
